﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Text;

namespace Campus
{
    class AnimatedMenuGraphic
    {
        #region Fields and Properties

        private Animation m_animation;

        /// <summary>
        /// The animation for the AnimatedGraphic object.
        /// </summary>
        public Texture2D Texture
        { 
            get
            {
                return m_animation.CurrentTexture;
            }
        }

        /// <summary>
        /// The position given within the MouseMenu's coordinate system.
        /// </summary>
        public Vector2 Position { get; private set; }

        #endregion

        #region Constructors

        /// <summary>
        /// MenuGraphic is a simple class that contains only a graphic and a position.
        /// This is used with the MouseMenu class and is drawn last in the MouseMenu and thus
        /// will appear on top of everything else.  The position of MenuGraphic should be
        /// given with the knowledge that (0, 0) will be located at the upper left of the
        /// MouseMenu NOT in the upper left of the screen.
        /// </summary>
        /// <param name="texture">The graphic to be drawn.</param>
        /// <param name="position">The position, within the MouseMenu's coordinate system.</param>
        public AnimatedMenuGraphic(Animation animation, Vector2 position)
        {
            this.m_animation = animation;
            this.Position = position;
            m_animation.Start();
        }

        #endregion

        #region Methods

        public void Update(GameTime gameTime)
        {
            m_animation.Update(gameTime);
        }

        #endregion
    }
}
